define(['app'], function(app) {
	'use strict';

	// 实例化方法
	var factory = function(Http) {
		/**
		 * 一键切换数据获取方式
		 * @param {Object} result
		 */
		function get_data_detail(result){
			if(false){
				result = '{"success":true,"msg":"","result":{"id":"001","title":"青春无限","video":{"id":"001","video_url":""},"company_profile":"五金专卖","apply_time":"2017/01/01 09:00:00","view_count":10,"share_count":100,"store_id":"001","store_name":"未来万家五金"},"session":"7311da98bd0f18eb15a96bcb263f4153"}';
				return JSON.parse(result);
			} else {
				return result;
			}
		}
		// 返回信息
		return {
			// 获取明星企业详细
			get_detail : function(id, callback) {
				Http.post({
					method : 'info.starenterprise.detail',
					id : id
				},function(result){
					if(callback)
						callback(get_data_detail(result).result);
				},function(e){

				},function(){

				});
			}
			
			
		};
	}

	factory.$inject = [ 'Http' ];
	return app.registerService("Stardetail", factory);
});